package com.xpjhs.resources.web.controller;

import java.util.List;





import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xpjhs.resources.model.Resources;
import com.xpjhs.resources.model.ResourcesType;
import com.xpjhs.resources.service.ResourcesService;

/**
 * 这里只是查询所有的，不需要过滤查看单个的
 * 
 * @author guohuijun
 * @createDate 2014年7月18日 上午11:37:07 @ QQ: 263235040
 */
@Controller
@RequestMapping("/resources")
public class ResourcesController {

	@Autowired
	private ResourcesService reService;

	@RequestMapping(value = "/junior")
	public String junior(ModelMap modelMap) {
		List<Resources> resources = reService.findAll();
		modelMap.addAttribute("resourceType", ResourcesType.values());
		modelMap.addAttribute("resources", resources);
		return "resources/junior";
	}

	@RequestMapping(value = "/inter")
	public String inter(ModelMap modelMap) {
		System.out.println(" inter");
		return "resources/inter";
	}

	@RequestMapping(value = "/senior")
	public String senior(ModelMap modelMap) {
		System.out.println(" senior");
		return "resources/senior";
	}

	@RequestMapping(value = "/groom")
	public String groom(ModelMap modelMap) {
		System.out.println(" groom");
		return "resources/groom";
	}

	@RequestMapping(value = "/other")
	public String other(ModelMap modelMap) {
		System.out.println(" other");
		return "resources/other";
	}

}
